package com.wing.order.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.order.model.entity.OrderDeliverySign;
import com.wing.order.model.request.OrderDeliverySignForm;
import com.wing.order.model.response.*;

import java.util.List;
import java.util.Map;

/**
 * 签收记录-Service
 *
 * @author
 */
public interface OrderDeliverySignService extends IService<OrderDeliverySign> {

    /**
     * 添加
     *
     * @param orderDeliverySignForm
     * @return
     */
    int add(OrderDeliverySignForm orderDeliverySignForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<OrderDeliverySignVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<OrderDeliverySignVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    OrderDeliverySignVO get4appById(Long id);

    Integer countNotFinish(Long signId);

    /**
     * 签收记录列表
     * @param page
     * @param limit
     * @param orderDeliverySignVO
     * @return
     */
    IPage<OrderDeliverySignVO> getOrderDeliverySignVOPageList(Integer page, Integer limit,OrderDeliverySignVO orderDeliverySignVO);

    /**
     * 签收记录详情
     * @param page
     * @param limit
     * @param signId
     * @return
     */
    IPage<OrderDeliverySignDetailVO> getSignDetailList(Integer page, Integer limit, Long signId);

    /**
     * 签收物资入库详情
     * @param page
     * @param limit
     * @param signId
     * @return
     */
    IPage<OrderDeliverySignDetailVO> getSignStorageDetailList(Integer page, Integer limit, Long signId);
    /**
     * 查询料箱
     * @param code
     * @return
     */
    WorkbinVO getWorkbinByCode(String code);
    /**
     * 查询托盘存放物资列表
     * @param boxId
     * @return
     */
    List<MaterialVO> getMaterialVOListById(Long boxId);

    /**
     * 扫描包装条码
     * @param packLabelCode
     * @param signId
     * @return
     */
    OrderDeliveryLabelVO getDeliveryLabelVOByCode(String packLabelCode,Long signId);

    /**
     * 查询产品的料箱
     * @return
     */
    List<WorkbinVO> getProductBoxByDetailId(Long deliveryDetailId);

    /**
     * 查询料箱的包装条码
     * @param boxId
     * @return
     */
    List<OrderDeliveryLabelVO> getDeliveryLabelVOByBoxId(Long boxId);

    /**
     * 进销存入库签收列表
     * @param page
     * @param limit
     * @param orderDeliverySignVO
     * @return
     */
    IPage<OrderDeliverySignVO> getInventorySignVOPageList(Integer page, Integer limit,OrderDeliverySignVO orderDeliverySignVO);

    /**
     * 异常列表-app
     *
     * @param id 签收记录id
     *
     * @return
     */
    List<OrderDeliverySignVO> abnormalList(Long id);

    Page<OrderDeliverySignVO> getPurchaseSignVOPageList(Page page, Map<String, Object> params);

    OrderDeliverySignVO getPurchaseSignVOById(Long id);

//    List<OrderDeliverySignDetailVO> getPurchaseSignDetailVO (Long id);

    /**
     * 查询签收单以及产品
     * @param code
     * @param signType
     * @return
     */
    OrderDeliverySignVO getDeliverySignInfo(String code, Integer signType);
}
